package sprinklerbee.model;

import java.util.*;

/**
 * This object is used for retrieve and save data into database
 * 
 * @author kelvin
 * 
 */
public class Configuration {

	/**
	 * A configuraion's indentity
	 */
	private long id;

	/**
	 * A configuration's key
	 */
	private String name;
	/**
	 * The value for the key
	 */
	private String value;
	/**
	 * Some description for configuration object
	 */
	private String description;

	/**
	 * A configuration's create time
	 */
	private Date creatime;

	/**
	 * Get the identity for a configuration
	 * 
	 * @return configuration's primary key
	 */
	public long getId() {
		return id;
	}

	/**
	 * Set the identity for a configuration
	 * 
	 * @param id
	 *            configuration's primary key, which is generated by database's
	 *            auto-increasement
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * Get a configuration's name, which is also unique, something like maxTemp,
	 * minTemp
	 * 
	 * @return a configuration's unique name, or key
	 */
	public String getName() {
		return name;
	}

	/**
	 * Set a name for a configuration
	 * 
	 * @param name
	 *            set the key for a configuration
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get a configuration's value for the key
	 * 
	 * @return
	 */
	public String getValue() {
		return value;
	}

	/**
	 * Set value for a key in the configuration
	 * 
	 * @param value
	 *            any numbers
	 */
	public void setValue(String value) {
		this.value = value;
	}

	/**
	 * Get description for a configuration
	 * 
	 * @return the desction
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Set descriptioin for a configuration
	 * 
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Get the create time for a configuration
	 * 
	 * @return the create time
	 */
	public Date getCreatime() {
		return creatime;
	}

	/**
	 * Set the create time for a configuration
	 * 
	 * @param creatime
	 *            the create time
	 */
	public void setCreatime(Date creatime) {
		this.creatime = creatime;
	}

	/**
	 * Set a name and value for a configuration
	 * 
	 * @param name
	 *            key for the configuration
	 * @param value
	 *            value for the key
	 */
	public Configuration(String name, String value) {
		super();
		this.name = name;
		this.value = value;
	}

	/**
	 * Default constuctor
	 */
	public Configuration() {
		super();
	}

}